import http from "./http";

const categories = () => http.get('/categories')

const search = (params) => {
  return http.get('/search', {
    params
  });
}

const getDefaultAddress = () => {
  return http.get('/address/default');
}

const getAddressDetail = (id) => {
  return http.get(`/address/${id}`)
}

const createOrder = (params) => {
  return http.post('/saveOrder', params);
}

export default {
  categories,
  search,
  getDefaultAddress,
  getAddressDetail,
  createOrder
};